import Vue from "vue"
import Router from "vue-router"
import Login from "./views/login.vue"
import Index from "./views/index.vue"
import UserList from "./views/user-list.vue"
import RoleList from "./views/role-list.vue"
import SellerList from "./views/seller-list.vue"
import ClientList from "./views/client-list.vue"
import PermissionList from "./views/permission-list.vue"
import ProductList from "./views/product-list.vue"
import StockList from "./views/stock-list.vue"
import PurchaseOrderList from "./views/purchase-order-list"
import InspectionOrderList from "./views/inspection-order-list"
import SellOrderList from "./views/sell-order-list"
import OutOrderList from "./views/out-order-list"
import IncomingOrderList from "./views/incoming-order-list"

Vue.use(Router);

export default new Router({
    mode: "history",
    base: process.env.BASE_URL,
    routes: [{
        path: "*",
        redirect: "/login",
    }, {
        path: "/login",
        component: Login
    }, {
        path: "/index",
        component: Index,
        meta: {
            loginRequire: true
        }
    }, {
        path: "/user-list",
        component: UserList,
        meta: {
            loginRequire: true
        }
    }, {
        path: "/role-list",
        component: RoleList,
        meta: {
            loginRequire: true
        }
    }, {
        path: "/seller-list",
        component: SellerList,
        meta: {
            loginRequire: true
        }
    }, {
        path: "/client-list",
        component: ClientList,
        meta: {
            loginRequire: true
        }
    }, {
        path: "/permission-list",
        component: PermissionList,
        meta: {
            loginRequire: true
        }
    },{
        path: "/product-list",
        component: ProductList,
        meta: {
            loginRequire: true
        }
    },{
        path: "/stock-list",
        component: StockList,
        meta: {
            loginRequire: true
        }
    },{
        path: "/purchase-order-list",
        component: PurchaseOrderList,
        meta: {
            loginRequire: true
        }
    },{
        path: "/inspection-order-list",
        component: InspectionOrderList,
        meta: {
            loginRequire: true
        }
    },{
        path: "/sell-order-list",
        component: SellOrderList,
        meta: {
            loginRequire: true
        }
    },{
        path: "/out-order-list",
        component: OutOrderList,
        meta: {
            loginRequire: true
        }
    },{
        path: "/incoming-order-list",
        component: IncomingOrderList,
        meta: {
            loginRequire: true
        }
    }]
})